<template>
    <div>
        <!-- 面包屑 -->
        <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/home' }"
                >首页</el-breadcrumb-item
            >
            <el-breadcrumb-item>会员管理</el-breadcrumb-item>
        </el-breadcrumb>
        <!-- 会员管理表格 -->
        <list @changeBtn="changeBtn" @sendval="sendval" ref="list"></list>
        <!-- 弹框 -->
        <v-dialog
            :isDialog="isDialog"
            :row="row"
            @changeBtn="changeBtn"
            @update="update"
        ></v-dialog>
    </div>
</template>

<script>
import vDialog from "../components/member/dialog.vue";
import list from "../components/member/list.vue";
export default {
    data() {
        return {
            //控制dialog弹框
            isDialog: false,
            row:'',
        };
    },
    methods: {
        //接收列表发过来的 点击编辑 按钮 显示对应内容
        changeBtn(e) {
            this.isDialog = e;
        },
        //接收编辑传递的数据，获得点击的所有信息，dialog通过props获取数据
        sendval(e){
            this.row = {...e,password:''}
        },
        //dialog子组件触发后，调用list子组件内的changeData方法
        update(){
            this.$refs.list.changeData()
        }
    },
    components: {
        vDialog,
        list,
    },
};
</script>

<style scoped>
.el-breadcrumb {
    margin-bottom: 30px;
}
</style>

<style scoped></style>
